#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long LL;
int n;
int main()
{
	cin >> n;
	vector<int> arr;
	arr.resize(n * 3);
	LL sum = 0;
	for (int i = 0; i < n * 3; i++) {
		cin >> arr[i];
	}
	sort(arr.begin(), arr.end());
	for (int i = 0; i < n; i++) {
		//cout << arr[arr.size() - 2 * (i + 1)] << endl;
		sum += arr[arr.size() - 2 * (i + 1)];
	}
	cout << sum << endl;
	return 0;
}